Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add .todo helper for describe, it, and test #633

Merged
merged 12 commits into from
Aug 1, 2024
Merged

feat: add .todo helper for describe, it, and test #633

merged 12 commits into from
Aug 1, 2024

Conversation

wellwelwel
Copy link
Owner

@wellwelwel wellwelwel commented Jul 31, 2024

Closes #563.


📋 todo

.todo is an extended helper for describe, it, and test to assist you plan future tests.

Basic Usage

Simple message

import { describe, it, test } from 'poku';

describe.todo('todo: Upcoming test');

it.todo('todo: Upcoming test');

test.todo('todo: Upcoming test');
  • There is no difference between the features.

Also in internal contexts:

import { describe, it } from 'poku';

describe(() => {
  it.todo('todo: Upcoming test');

  it('Real test', () => {
    /* ... */
  });
});

Ignoring a callback

This can be useful when you already have an idea or prototype of what you want to test, but you don't want the test to actually run.

It can also be useful for tests that have unexpectedly stopped working due to some external event, requiring further attention.

import { describe, it } from 'poku';

describe.todo('todo: Upcoming test', () => {
  it(async () => {
    process.exit(1);
  });
});
  • The method received by todo and everything inside it will be completely ignored.

When using beforeEach or afterEach, they will not be triggered by tests with .todo.

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.67%. Comparing base (03005a5) to head (aa3d74e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #633      +/-   ##
==========================================
+ Coverage   97.74%   98.67%   +0.92%     
==========================================
  Files          35       36       +1     
  Lines        1997     2037      +40     
  Branches       22       12      -10     
==========================================
+ Hits         1952     2010      +58     
+ Misses         26       16      -10     
+ Partials       19       11       -8     
Flag Coverage Δ
linux 98.62% <100.00%> (+1.07%) ⬆️
osx 99.02% <100.00%> (+1.19%) ⬆️
windows ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wellwelwel wellwelwel marked this pull request as ready for review July 31, 2024 10:41
@wellwelwel wellwelwel merged commit 526112c into main Aug 1, 2024
28 checks passed
@wellwelwel wellwelwel deleted the todo branch August 1, 2024 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to plan tests with todo flag
1 participant